package com.dudetest.data.objectify.independent;

import javax.persistence.Id;

import com.dudetest.data.DAOFactory;
import com.dudetest.dude.DudeA;
import com.dudetest.dude.DudeAImpl;
import com.googlecode.objectify.Key;
import com.googlecode.objectify.annotation.Cached;
import com.googlecode.objectify.annotation.Entity;
import com.googlecode.objectify.annotation.Unindexed;

@Entity
@Cached
@Unindexed
public class DudeAIndependent extends DudeAImpl implements DudeA {
	@Id private long id;
	private int a;
	
	public DudeAIndependent(){
		super();
	}
	
	public DudeAIndependent(long id){
		super(id);
	}

	public Key<DudeAIndependent> getKey(){
		return new Key<DudeAIndependent>(DudeAIndependent.class,this.getId());
	}

	public String getReference(){
		return DAOFactory.fact().keyToString(this.getKey());
	}
	
	/*###################################
	 * FROM HERE ON, NOTHING INTERESTING
	 ####################################*/
	
	@Override
	public long getId(){
		return this.id;
	}

	@Override
	public void setId(long id) {
		this.id = id;
	}
	
	@Override
	public int getA() {
		return this.a;
	}
	
	@Override
	public void setA(int a){
		this.a = a;
	}
	
	@Override
	public String toString(){
		return "DudeAIndependent = [Id="+this.getId()+", "
			+"Reference="+this.getReference()+", "
			+"Key="+this.getKey()+", "
			+"A="+this.getA()
			+"]";
	}

}
